﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SIPDTO;
using System.Data;

namespace SIP
{
    public partial class ListadoMatrimonios : System.Web.UI.Page
    {

        #region ** Declaración de variables
        List<dtoMatrimonio> _dtmatrimonio = new List<dtoMatrimonio>();
        SIPBLL.SIPBLL _bll = new SIPBLL.SIPBLL();
        dtoMatrimonio _dtomatrimonio = new dtoMatrimonio();
        dtoError _resp = new dtoError();

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                CargarMatrimonios();
                Session["Crear"] = true;
            }
        }

        private void CargarMatrimonios()
        {
            _dtomatrimonio.IdParroquia = Convert.ToInt16(Session["Parroquia"]);
            _dtmatrimonio = _bll.ObtenerMatrimonioxParroquia(_dtomatrimonio);
            Grid.DataSource = _dtmatrimonio;
            Grid.DataBind();
        }


        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            Session["Crear"] = true;
            Response.Redirect("ConstanciaMatrimonio.aspx");
        }

    }
}